package love.yuanmeng.guetcoalsystem.cotroller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;

/*
 *   @Studio:CHJY · 源梦科技
 *   @Author:CHJY创幻
 *   @Ide:IntelliJ IDEA
 *   @Creation time:2021/9/26 12:33
 */
@Controller
@RequestMapping("bus")
public class BusinessController {
    @GetMapping("/toindex")//转发的写法，即跳转到html
    public String toindex(HttpServletRequest request, ModelMap map) {

        String path = request.getContextPath();
        String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
        map.put("css_nav", basePath + "css/nav.css");
//        ModelAndView modelAndView = new ModelAndView();
//        modelAndView.setViewName("myinfo/myinfo");
//        modelAndView.addObject("user","1123");
        map.put("user", basePath + "css/nav.css");
        return "index";
    }

}
